package com.wssnail.redis.key;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

/**
 * @Author: 熟透的蜗牛
 * @CreateTime: 2022-07-07 13:43
 * @Description: 键值的前缀
 * @Version: 1.0
 */
@Data
public class BaseKey {
    @Value("${spring.application.name}")
    private String applicationName;
    @Value("${spring.profiles.active}")
    private String active;

    /**
     * 键值前缀
     */
    private String prefix;

    public String getPrefix() {
        StringBuffer sb = new StringBuffer();
        return sb.append(applicationName).append(":").append(active).append(":").toString();
    }
}
